{% extends 'base.html.twig' %}

{% block content %}
    {% include 'components/breadcrumbs.html.twig' %}

    <article class="phpdocumentor-element -trait">
        {{ include('components/trait-title.html.twig') }}
        {{ include('components/element-found-in.html.twig') }}
        {{ include('components/element-header.html.twig') }}

        {{ include('components/constants.html.twig') }}
        {{ include('components/properties.html.twig') }}
        {{ include('components/methods.html.twig') }}
        {{ include('components/source-modal.html.twig') }}
    </article>
{% endblock %}

{% block on_this_page %}
    {% set constants = constants(node) %}
    {% set properties = properties(node) %}
    {% set methods = methods(node) %}

    <section class="phpdocumentor-on-this-page__content">
        <strong class="phpdocumentor-on-this-page__title">On this page</strong>

        <ul class="phpdocumentor-list -clean">
            <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
            <li>
                <ul class="phpdocumentor-list -clean">
                    {% if constants is not empty %}
                    <li><a href="{{ link(node) }}#toc-constants">Constants</a></li>
                    {% endif %}
                    {% if properties is not empty %}
                    <li><a href="{{ link(node) }}#toc-properties">Properties</a></li>
                    {% endif %}
                    {% if methods is not empty %}
                    <li><a href="{{ link(node) }}#toc-methods">Methods</a></li>
                    {% endif %}
                </ul>
            </li>
            {% if constants is not empty %}
            <li class="phpdocumentor-on-this-page-section__title">Constants</li>
            <li>
                <ul class="phpdocumentor-list -clean">
                    {% for constant in constants|sortByVisibility %}
                        <li class="{% if constant.deprecated %}-deprecated{% endif %}"><a href="{{ link(constant) }}">{{ constant.name }}</a></li>
                    {% endfor %}
                </ul>
            </li>
            {% endif %}
            {% if properties is not empty %}
            <li class="phpdocumentor-on-this-page-section__title">Properties</li>
            <li>
                <ul class="phpdocumentor-list -clean">
                    {% for property in properties|sortByVisibility %}
                        <li class="{% if property.deprecated %}-deprecated{% endif %}"><a href="{{ link(property) }}">${{ property.name }}</a></li>
                    {% endfor %}
                </ul>
            </li>
            {% endif %}
            {% if methods is not empty %}
            <li class="phpdocumentor-on-this-page-section__title">Methods</li>
            <li>
                <ul class="phpdocumentor-list -clean">
                    {% for method in methods|sortByVisibility %}
                        <li class="{% if method.deprecated %}-deprecated{% endif %}"><a href="{{ link(method) }}">{{ method.name }}()</a></li>
                    {% endfor %}
                </ul>
            </li>
            {% endif %}
        </ul>
    </section>
{% endblock %}
